/**
 * Date:2017年12月25日上午11:09:32
 *
 */

package com.xue.action;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xue.common.lock.annotations.LockAction;

/**
 * Description: 测试分布式锁 <br/>
 * Date: 2017年12月25日 上午11:09:32 <br/>
 * 
 * @author xuejianxinokok@163.com
 */

@RequestMapping(value = DemoController.PATH)
@RestController("demoController")
public class DemoController {
	public static final String PATH = "/";
	private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(DemoController.class);

	@RequestMapping(value = "/test")
	@LockAction(value = "'testlock'") // key='testlock'
	public String test() {
		log.info("test ok");
		return "test ok";
	}

	@RequestMapping(value = "/test1")
	@LockAction(value = "'test1_'+#id")
	public String test1( String id) {
		log.info("test1 ok " + id);
		return "test1 ok " + id;
	}

}
